import React from 'react'
import PropTypes from 'prop-types'

const Case = ({ component, render }) => {
  if (component) return React.createElement(component)
  if (render) return render()
  return null
}

Case.propTypes = {
  component: PropTypes.func,
  render: PropTypes.func,
}

Case.defaultProps = {
  component: undefined,
  render: undefined,
}

export default Case
